Integrand size = 31, antiderivative size = 572 \[ \int (a+b x)^2 (c+d x)^{-4-m} (e+f x)^m (g+h x) \, dx=\frac {(b c-a d) (d g-c h) (a d f+b (c f (2+m)-d e (3+m))) (c+d x)^{-3-m} (e+f x)^{1+m}}{d^3 f (d e-c f) (3+m)}-\frac {b (d g-c h) (a+b x) (c+d x)^{-3-m} (e+f x)^{1+m}}{d^2 f}-\frac {(b c-a d)^2 h (c+d x)^{-2-m} (e+f x)^{1+m}}{d^3 (d e-c f) (2+m)}-\frac {(d g-c h) \left (b^2 (d e-c f) (2+m) (c f (1+m)-d e (3+m))-2 d f \left (b^2 c e+a^2 d f+a b (c f (1+m)-d e (3+m))\right )\right ) (c+d x)^{-2-m} (e+f x)^{1+m}}{d^3 f (d e-c f)^2 (2+m) (3+m)}-\frac {(b c-a d) h (a d f-b (2 d e (2+m)-c f (3+2 m))) (c+d x)^{-1-m} (e+f x)^{1+m}}{d^3 (d e-c f)^2 (1+m) (2+m)}+\frac {(d g-c h) \left (b^2 (d e-c f) (2+m) (c f (1+m)-d e (3+m))-2 d f \left (b^2 c e+a^2 d f+a b (c f (1+m)-d e (3+m))\right )\right ) (c+d x)^{-1-m} (e+f x)^{1+m}}{d^3 (d e-c f)^3 (1+m) (2+m) (3+m)}-\frac {b^2 h (c+d x)^{-m} (e+f x)^m \left (\frac {d (e+f x)}{d e-c f}\right )^{-m} \operatorname {Hypergeometric2F1}\left (-m,-m,1-m,-\frac {f (c+d x)}{d e-c f}\right )}{d^4 m} \]
[Out]
Time = 0.41 (sec) , antiderivative size = 566, normalized size of antiderivative = 0.99, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.258, Rules used = {165, 91, 80, 72, 71, 92, 47, 37} \[ \int (a+b x)^2 (c+d x)^{-4-m} (e+f x)^m (g+h x) \, dx=-\frac {(d g-c h) (c+d x)^{-m-2} (e+f x)^{m+1} \left (b^2 (m+2) (d e-c f) (c f (m+1)-d e (m+3))-2 d f \left (a^2 d f+b (a c f (m+1)-a d e (m+3)+b c e)\right )\right )}{d^3 f (m+2) (m+3) (d e-c f)^2}+\frac {(d g-c h) (c+d x)^{-m-1} (e+f x)^{m+1} \left (b^2 (m+2) (d e-c f) (c f (m+1)-d e (m+3))-2 d f \left (a^2 d f+b (a c f (m+1)-a d e (m+3)+b c e)\right )\right )}{d^3 (m+1) (m+2) (m+3) (d e-c f)^3}+\frac {(b c-a d) (d g-c h) (c+d x)^{-m-3} (e+f x)^{m+1} (a d f+b c f (m+2)-b d e (m+3))}{d^3 f (m+3) (d e-c f)}-\frac {h (b c-a d)^2 (c+d x)^{-m-2} (e+f x)^{m+1}}{d^3 (m+2) (d e-c f)}-\frac {h (b c-a d) (c+d x)^{-m-1} (e+f x)^{m+1} (a d f+b c f (2 m+3)-2 b d e (m+2))}{d^3 (m+1) (m+2) (d e-c f)^2}-\frac {b (a+b x) (d g-c h) (c+d x)^{-m-3} (e+f x)^{m+1}}{d^2 f}-\frac {b^2 h (c+d x)^{-m} (e+f x)^m \left (\frac {d (e+f x)}{d e-c f}\right )^{-m} \operatorname {Hypergeometric2F1}\left (-m,-m,1-m,-\frac {f (c+d x)}{d e-c f}\right )}{d^4 m} \]
[In]
[Out]
Rule 37
Rule 47
Rule 71
Rule 72
Rule 80
Rule 91
Rule 92
Rule 165
Rubi steps \begin{align*} \text {integral}& = \frac {h \int (a+b x)^2 (c+d x)^{-3-m} (e+f x)^m \, dx}{d}+\frac {(d g-c h) \int (a+b x)^2 (c+d x)^{-4-m} (e+f x)^m \, dx}{d} \\ & = -\frac {b (d g-c h) (a+b x) (c+d x)^{-3-m} (e+f x)^{1+m}}{d^2 f}-\frac {(b c-a d)^2 h (c+d x)^{-2-m} (e+f x)^{1+m}}{d^3 (d e-c f) (2+m)}-\frac {(d g-c h) \int (c+d x)^{-4-m} (e+f x)^m \left (-a^2 d f-b (b c e+a c f (1+m)-a d e (3+m))+b^2 (d e-c f) (2+m) x\right ) \, dx}{d^2 f}+\frac {h \int (c+d x)^{-2-m} (e+f x)^m \left (-a^2 d^2 f+b^2 c (c f (1+m)-d e (2+m))-2 a b d (c f (1+m)-d e (2+m))+b^2 d (d e-c f) (2+m) x\right ) \, dx}{d^3 (d e-c f) (2+m)} \\ & = \frac {(b c-a d) (d g-c h) (a d f+b c f (2+m)-b d e (3+m)) (c+d x)^{-3-m} (e+f x)^{1+m}}{d^3 f (d e-c f) (3+m)}-\frac {b (d g-c h) (a+b x) (c+d x)^{-3-m} (e+f x)^{1+m}}{d^2 f}-\frac {(b c-a d)^2 h (c+d x)^{-2-m} (e+f x)^{1+m}}{d^3 (d e-c f) (2+m)}-\frac {(b c-a d) h (a d f-2 b d e (2+m)+b c f (3+2 m)) (c+d x)^{-1-m} (e+f x)^{1+m}}{d^3 (d e-c f)^2 (1+m) (2+m)}+\frac {\left (b^2 h\right ) \int (c+d x)^{-1-m} (e+f x)^m \, dx}{d^3}+\frac {\left ((d g-c h) \left (\frac {b^2 (2+m) (c f (1+m)-d e (3+m))}{d}-\frac {2 f \left (b^2 c e+a^2 d f+a b (c f (1+m)-d e (3+m))\right )}{d e-c f}\right )\right ) \int (c+d x)^{-3-m} (e+f x)^m \, dx}{d^2 f (3+m)} \\ & = \frac {(b c-a d) (d g-c h) (a d f+b c f (2+m)-b d e (3+m)) (c+d x)^{-3-m} (e+f x)^{1+m}}{d^3 f (d e-c f) (3+m)}-\frac {b (d g-c h) (a+b x) (c+d x)^{-3-m} (e+f x)^{1+m}}{d^2 f}-\frac {(b c-a d)^2 h (c+d x)^{-2-m} (e+f x)^{1+m}}{d^3 (d e-c f) (2+m)}-\frac {(d g-c h) \left (\frac {b^2 (2+m) (c f (1+m)-d e (3+m))}{d}-\frac {2 f \left (b^2 c e+a^2 d f+a b (c f (1+m)-d e (3+m))\right )}{d e-c f}\right ) (c+d x)^{-2-m} (e+f x)^{1+m}}{d^2 f (d e-c f) (2+m) (3+m)}-\frac {(b c-a d) h (a d f-2 b d e (2+m)+b c f (3+2 m)) (c+d x)^{-1-m} (e+f x)^{1+m}}{d^3 (d e-c f)^2 (1+m) (2+m)}-\frac {\left ((d g-c h) \left (\frac {b^2 (2+m) (c f (1+m)-d e (3+m))}{d}-\frac {2 f \left (b^2 c e+a^2 d f+a b (c f (1+m)-d e (3+m))\right )}{d e-c f}\right )\right ) \int (c+d x)^{-2-m} (e+f x)^m \, dx}{d^2 (d e-c f) (2+m) (3+m)}+\frac {\left (b^2 h (e+f x)^m \left (\frac {d (e+f x)}{d e-c f}\right )^{-m}\right ) \int (c+d x)^{-1-m} \left (\frac {d e}{d e-c f}+\frac {d f x}{d e-c f}\right )^m \, dx}{d^3} \\ & = \frac {(b c-a d) (d g-c h) (a d f+b c f (2+m)-b d e (3+m)) (c+d x)^{-3-m} (e+f x)^{1+m}}{d^3 f (d e-c f) (3+m)}-\frac {b (d g-c h) (a+b x) (c+d x)^{-3-m} (e+f x)^{1+m}}{d^2 f}-\frac {(b c-a d)^2 h (c+d x)^{-2-m} (e+f x)^{1+m}}{d^3 (d e-c f) (2+m)}-\frac {(d g-c h) \left (\frac {b^2 (2+m) (c f (1+m)-d e (3+m))}{d}-\frac {2 f \left (b^2 c e+a^2 d f+a b (c f (1+m)-d e (3+m))\right )}{d e-c f}\right ) (c+d x)^{-2-m} (e+f x)^{1+m}}{d^2 f (d e-c f) (2+m) (3+m)}-\frac {(b c-a d) h (a d f-2 b d e (2+m)+b c f (3+2 m)) (c+d x)^{-1-m} (e+f x)^{1+m}}{d^3 (d e-c f)^2 (1+m) (2+m)}+\frac {(d g-c h) \left (\frac {b^2 (2+m) (c f (1+m)-d e (3+m))}{d}-\frac {2 f \left (b^2 c e+a^2 d f+a b (c f (1+m)-d e (3+m))\right )}{d e-c f}\right ) (c+d x)^{-1-m} (e+f x)^{1+m}}{d^2 (d e-c f)^2 (1+m) (2+m) (3+m)}-\frac {b^2 h (c+d x)^{-m} (e+f x)^m \left (\frac {d (e+f x)}{d e-c f}\right )^{-m} \, _2F_1\left (-m,-m;1-m;-\frac {f (c+d x)}{d e-c f}\right )}{d^4 m} \\ \end{align*}
Time = 1.15 (sec) , antiderivative size = 422, normalized size of antiderivative = 0.74 \[ \int (a+b x)^2 (c+d x)^{-4-m} (e+f x)^m (g+h x) \, dx=\frac {(c+d x)^{-3-m} (e+f x)^m \left (-d (d g-c h) (e+f x) \left (-\left ((b c-a d) (d e-c f)^2 (1+m) (2+m) (a d f+b c f (2+m)-b d e (3+m))\right )+b d (d e-c f)^3 (1+m) (2+m) (3+m) (a+b x)+\left (b^2 (d e-c f) (2+m) (c f (1+m)-d e (3+m))+2 d f \left (-a^2 d f-b (b c e+a c f (1+m)-a d e (3+m))\right )\right ) (c+d x) (-c f (2+m)+d (e+e m-f x))\right )-(d e-c f) h (3+m) (c+d x) \left (d (b c-a d)^2 f (d e-c f) (1+m) (e+f x)-(c+d x) \left (d \left (a^2 d^2 f^2+2 a b d f (c f (1+m)-d e (2+m))+b^2 \left (-c^2 f^2 (1+m)+d^2 e^2 (2+m)\right )\right ) (e+f x)-b^2 (d e-c f)^3 (2+m) \left (\frac {d (e+f x)}{d e-c f}\right )^{-m} \operatorname {Hypergeometric2F1}\left (-1-m,-1-m,-m,\frac {f (c+d x)}{-d e+c f}\right )\right )\right )\right )}{d^4 f (d e-c f)^3 (1+m) (2+m) (3+m)} \]
[In]
[Out]
\[\int \left (b x +a \right )^{2} \left (d x +c \right )^{-4-m} \left (f x +e \right )^{m} \left (h x +g \right )d x\]
[In]
[Out]
\[ \int (a+b x)^2 (c+d x)^{-4-m} (e+f x)^m (g+h x) \, dx=\int { {\left (b x + a\right )}^{2} {\left (h x + g\right )} {\left (d x + c\right )}^{-m - 4} {\left (f x + e\right )}^{m} \,d x } \]
[In]
[Out]
Exception generated. \[ \int (a+b x)^2 (c+d x)^{-4-m} (e+f x)^m (g+h x) \, dx=\text {Exception raised: HeuristicGCDFailed} \]
[In]
[Out]
\[ \int (a+b x)^2 (c+d x)^{-4-m} (e+f x)^m (g+h x) \, dx=\int { {\left (b x + a\right )}^{2} {\left (h x + g\right )} {\left (d x + c\right )}^{-m - 4} {\left (f x + e\right )}^{m} \,d x } \]
[In]
[Out]
\[ \int (a+b x)^2 (c+d x)^{-4-m} (e+f x)^m (g+h x) \, dx=\int { {\left (b x + a\right )}^{2} {\left (h x + g\right )} {\left (d x + c\right )}^{-m - 4} {\left (f x + e\right )}^{m} \,d x } \]
[In]
[Out]
Timed out. \[ \int (a+b x)^2 (c+d x)^{-4-m} (e+f x)^m (g+h x) \, dx=\int \frac {{\left (e+f\,x\right )}^m\,\left (g+h\,x\right )\,{\left (a+b\,x\right )}^2}{{\left (c+d\,x\right )}^{m+4}} \,d x \]
[In]
[Out]